From bb09427c71cd621637565fb906c2114a2a6878cf Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 25 Jan 2008 13:26:38 +0000 Subject: [PATCH] x86: Fix host S3. Time zone info just needs to be calculated in S3 suspend procedure. However, time_suspend() is also called on AP. That wasteful get_cmos_time() on AP may break __cpu_die() assumption since get_cmos_time() can take up to one second. This fix just limits it to running on the BSP. Signed-off-by: Xu Dongxiao --- xen/arch/x86/time.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 6d4946245b..3793c4bb2c 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -976,8 +976,11 @@ static long cmos_utc_offset; /* in seconds */ int time_suspend(void) { - cmos_utc_offset = (wc_sec + (wc_nsec + NOW()) / 1000000000ULL) - - get_cmos_time(); + if ( smp_processor_id() == 0 ) + { + cmos_utc_offset = -get_cmos_time(); + cmos_utc_offset += (wc_sec + (wc_nsec + NOW()) / 1000000000ULL); + } /* Better to cancel calibration timer for accuracy. */ kill_timer(&this_cpu(cpu_time).calibration_timer); -- 2.30.2